<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h4 class="modal-title">核算明细</h4>
</div>
<style>
    .table > tbody > tr > td, .table > thead > tr > th {
        text-align: center;
        vertical-align: middle;
    }
</style>
<div class="modal-body" style="max-height: 550px;overflow-y:scroll">
    <div class="box-body">
        <h4>基础信息</h4>
        <div class="box-body table-responsive no-padding">
            <table class="table">
                <thead>
                <tr>
                    <th>日期</th>
                    <th>国家</th>
                    <th>品类</th>
                    <th>汇率</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td>{{ $basics['date'] }} </td>
                    <td>{{ $basics['country'] }} </td>
                    <td>{{ $basics['title'] }} </td>
                    <td>{{ $basics['rateOdds'] }}</td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
    <div class="box-body">
        <h4>校验结果</h4>
        <div class="box-body table-responsive no-padding">
            <table class="table">
                <thead>
                <tr>
                    <th><a href="javascript:void(0)"
                           data-container="body"
                           data-toggle="popover"
                           data-placement="top"
                           data-html="true"
                           data-trigger="hover"
                           data-content="明细产品毛利和">产品总毛利</a>
                    </th>
                    <th>广告费用</th>
                    <th>刷单费用</th>
                    <th>促销费</th>
                    <th><a href="javascript:void(0)"
                           data-container="body"
                           data-toggle="popover"
                           data-placement="top"
                           data-html="true"
                           data-trigger="hover"
                           data-content="产品总毛利-广告费用-刷单费用-促销费">核算毛利</a>
                    </th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td>{{ $profit }} </td>
                    <td>{{ $spend }} </td>
                    <td>{{ $reimburse }} </td>
                    <td>{{ $promotionDiscount }} </td>
                    <td>{{ $pt }} </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
    <div class="box-body">
        <h4>明细</h4>
        <div class="box-body table-responsive no-padding">
            <table class="table">
                <thead>
                <tr>
                    <th>SKU_ID</th>
                    <th>SKU_CODE</th>
                    <th>销售额</th>
                    <th>匹配状态</th>
                    <th>销量</th>
                    <th><a href="javascript:void(0)"
                           data-container="body"
                           data-toggle="popover"
                           data-placement="top"
                           data-html="true"
                           data-trigger="hover"
                           data-content="采购单价*销量">总采购成本</a>
                    </th>
                    <th><a href="javascript:void(0)"
                           data-container="body"
                           data-toggle="popover"
                           data-placement="top"
                           data-html="true"
                           data-trigger="hover"
                           data-content="平均运费*销量">总运费</a>
                    </th>
                    <th>Fba费</th>
                    <th>Commission</th>
                    <th><a href="javascript:void(0)"
                           data-container="body"
                           data-toggle="popover"
                           data-placement="top"
                           data-html="true"
                           data-trigger="hover"
                           data-content="Commission*销售额">Commission费</a></th>
                    <th>退货率</th>
                    <th><a href="javascript:void(0)"
                           data-container="body"
                           data-toggle="popover"
                           data-placement="top"
                           data-html="true"
                           data-trigger="hover"
                           data-content="退货率*销售额">退货费</a></th>
                    <th>vat</th>
                    <th><a href="javascript:void(0)"
                           data-container="body"
                           data-toggle="popover"
                           data-placement="top"
                           data-html="true"
                           data-trigger="hover"
                           data-content="vat*销售额">vat费</a></th>
                    <th><a href="javascript:void(0)"
                           data-container="body"
                           data-toggle="popover"
                           data-placement="top"
                           data-html="true"
                           data-trigger="hover"
                           data-content="1*销售额/100">库存费</a></th>
                    <th><a href="javascript:void(0)"
                           data-container="body"
                           data-toggle="popover"
                           data-placement="top"
                           data-html="true"
                           data-trigger="hover"
                           data-content="1*销售额/100">其它费</a></th>
                    <th><a href="javascript:void(0)"
                           data-container="body"
                           data-toggle="popover"
                           data-placement="top"
                           data-html="true"
                           data-trigger="hover"
                           data-content="总采购成本+总运费+Fba费+Commission+库存费+其它费+退货费+vat费">总成本</a>
                    </th>
                    <th>毛利本币</th>
                    <th>毛利RMB</th>
                </tr>
                </thead>
                <tbody>
                @foreach($prs as $pSkuId => $item)
                    <tr>
                        <td>{{ $pSkuId }}</td>
                        <td>{{ $item['psku_code'] }}</td>
                        <td>{{ $item['amount'] }}</td>
                        <td>{{ $item['tpye'] }}</td>
                        <td>{{ $item['tpye'] ? $item['volume'] : '' }}</td>
                        <td>{{ $item['tpye'] ? $item['tpl'] : '' }}</td>
                        <td>{{ $item['tpye'] ? $item['head_cost'] : '' }}</td>
                        <td>{{ $item['tpye'] ? $item['fba_fee'] : '' }}</td>
                        <td>{{ $item['tpye'] ? $item['commission'].'%' : '' }}</td>
                        <td>{{ $item['tpye'] ? round($item['amount'] * $item['commission'] / 100 ,3) : '' }}</td>
                        <td>{{ $item['tpye'] ? $item['return'].'%' : '' }}</td>
                        <td>{{ $item['tpye'] ? round($item['amount'] * $item['return'] / 100 ,3) : '' }}</td>
                        <td>{{ $item['tpye'] ? $item['vat'].'%' : '' }}</td>
                        <td>{{ $item['tpye'] ? round($item['amount'] * $item['vat'] / 100 ,3) : '' }}</td>
                        <td>{{ $item['tpye'] ? round($item['amount'] / 100 ,3) : '' }}</td>
                        <td>{{ $item['tpye'] ? round($item['amount'] / 100 ,3) : '' }}</td>
                        <td>{{ $item['tpye'] ? $item['cost'] : 0 }}</td>
                        <td>{{ $item['profit'] }}</td>
                        <td>{{ $item['profit_rmb'] }}</td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        </div>
    </div>
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
<script language="JavaScript" type="text/javascript">
    $(function () {
        $('[data-toggle="popover"]').popover();
    });
</script>
